//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IGuiForm.h>
///	@path	~/src/gui/
///	@date	2008/05/19
///	@desc	.

#pragma once

#include "xeres.h"

#include "gui/IGuiControl.h"

namespace xeres {

	/*! 
		\class	IGuiForm
		\brief	Form container of XGUI component.
	*/
	class IGuiForm : public IGuiControl
	{
	public:

		/// \ctor
		IGuiForm( const Rect<int>& placement );

		/// \dtor
		virtual ~IGuiForm( void );

		DECL_IOBJECT_INTERFACE( IGuiForm , IGuiControl );

	public:

		/// \name XGUI Form Interface
		//@{

		/// \brief	Clear focus.
		virtual void ClearFocus( Updater& updater ) = 0;

		/// \brief	Only clear focus.
		virtual void ClearFocus( void ) = 0;

		///	\brief	Get focus component.
		virtual RefWeak<IGuiComp> GetFocusing( void ) = 0;

		/// \brief	Enter input mode.
		virtual void EnterInputMode( RefWeak<IGuiComp> comp , Updater& updater ) = 0;

		/// \brief	Get input mode.
		virtual bool GetInputMode( void ) = 0;

		/// \brief	Add child component.
		virtual bool AddChild( RefWeak<IGuiComp> comp ) = 0;

		/// \brief	Del child component.
		virtual bool DelChild( RefWeak<IGuiComp> comp ) = 0;

		/// \brief	Get child by index.
		virtual RefWeak<IGuiComp> GetChild( int index ) = 0;

		/// \brief	Add tickable child.
		virtual void AddTickable( RefWeak<IGuiComp> comp ) = 0;

		/// \brief	Del tickable child.
		virtual void DelTickable( RefWeak<IGuiComp> comp ) = 0;

		/// \brief	Request focus.
		virtual void RequestFocus( RefWeak<IGuiComp> comp , Updater& updater ) = 0;

		/// \brief	Request focus only.
		virtual void RequestFocus( RefWeak<IGuiComp> comp ) = 0;

		/// \brief	Request update.
		virtual void RequestUpdate( RefWeak<IGuiComp> comp , const Rect<int>& region ) = 0;

		/// \brief	Request show component.
		virtual void RequestShow( RefWeak<IGuiComp> comp , bool show ) = 0;

		/// \brief	Set capturing component.
		virtual void SetCapture( RefWeak<IGuiComp> comp ) = 0;

		/// \brief	Get capturing component.
		virtual RefWeak<IGuiComp> GetCapture( void ) = 0;

		/// \brief	Release capture.
		virtual void ReleaseCapture( void ) = 0;

		//@}

	};

} // namespace xeres
